Jared Knowles
R has recently passed Stata on Google Scholar hits and it is catching up to the two major players SPSS and SAS
R is linked to from more and more sites
These links come from the explosion of add-on packages to R
Usage of the R listserv for help has really exploded recently
Read in Data
studat <- read.csv("data/smalldata.csv")
str(studat[5:18, ])
## 'data.frame': 14 obs. of 32 variables:
## $ X : int 274 276 478 574 613 620 717 772 1004 1056 ...
## $ school : int 1 1 1 1 1 1 1 1 1 1 ...
## $ stuid : int 142705 14995 120205 103495 55705 28495 37705 52705 41995 10705 ...
## $ grade : int 3 3 3 3 3 3 3 3 3 3 ...
## $ schid : int 205 495 205 495 205 495 205 205 495 205 ...
## $ dist : int 75 105 15 45 75 45 75 75 105 75 ...
## $ white : int 0 0 0 0 0 0 0 0 0 0 ...
## $ black : int 1 1 1 1 1 1 1 1 1 1 ...
## $ hisp : int 0 0 0 0 0 0 0 0 0 0 ...
## $ indian : int 0 0 0 0 0 0 0 0 0 0 ...
## $ asian : int 0 0 0 0 0 0 0 0 0 0 ...
## $ econ : int 1 1 1 1 1 0 1 0 1 1 ...
## $ female : int 0 0 0 0 0 0 0 0 0 0 ...
## $ ell : int 0 0 0 0 0 0 0 0 0 0 ...
## $ disab : int 0 0 0 0 0 0 0 0 0 0 ...
## $ sch_fay : int 0 0 0 0 0 0 0 0 0 0 ...
## $ dist_fay : int 0 0 0 0 0 0 0 0 0 0 ...
## $ luck : int 0 0 1 0 0 0 0 1 0 0 ...
## $ ability : num 81.9 101.9 87.3 96.6 98.4 ...
## $ measerr : num 52.98 22.6 4.67 -9.35 -7.7 ...
## $ teachq : num 56.68 71.62 66.88 75.21 4.95 ...
## $ year : int 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 ...
## $ attday : int 156 157 169 180 170 152 162 180 152 165 ...
## $ schoolscore: num 56 56 56 56 56 ...
## $ district : int 3 3 3 3 3 3 3 3 3 3 ...
## $ schoolhigh : int 0 0 0 0 0 0 0 0 0 0 ...
## $ schoolavg : int 1 1 1 1 1 1 1 1 1 1 ...
## $ schoollow : int 0 0 0 0 0 0 0 0 0 0 ...
## $ readSS : num 373 437 418 454 310 ...
## $ mathSS : num 441 463 436 434 284 ...
## $ proflvl : Factor w/ 4 levels "advanced","basic",..: 2 4 4 4 3 2 4 4 2 3 ...
## $ race : Factor w/ 5 levels "A","B","H","I",..: 2 2 2 2 2 2 2 2 2 2 ...
source("data/simulate_data.R")
source("ggplot2themes.R")
library(ggplot2)
qplot(readSS, mathSS, data = studat, alpha = I(0.2)) + geom_smooth(aes(group = ell,
color = factor(ell))) + theme_dpi()
plot of chunk unnamed-chunk-1
samp <- sample(studat$stuid, 24)
plotsub <- subset(studat, stuid %in% samp)
qplot(grade, readSS, data = plotsub) + facet_wrap(~stuid, nrow = 4,
ncol = 6) + theme_dpi() + geom_line() + geom_smooth(method = "lm", se = FALSE)
plot of chunk unnamed-chunk-2